package br.com.paiva.container.util;

import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
import javax.faces.event.ActionEvent;

public class ImportUtilits {
	
	public static Long getIdLink(ActionEvent event){
		
		UIComponent link = event.getComponent();
		UIParameter param = (UIParameter)link.findComponent("editId");
		
		Long idLink = (Long)param.getValue();
		
		return idLink; 
	}
	
   public static Long getParamLinkGeneric(ActionEvent event, String paranComponent){    	
    	
		UIComponent link = event.getComponent();		
		
		UIParameter param = (UIParameter)link.findComponent(paranComponent);
		
		Long idLink = (Long)param.getValue();
		
		return idLink; 
	}	
}
